package com.hotel.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.hotel.entity.VipInfo;
import com.hotel.service.VipInfoService;

@Controller
public class VipInfoController {
	
	@Autowired
	private VipInfoService vipInfoService;
	
	@RequestMapping(value="vipInfoList")
	public ModelAndView vipInfoList(HttpServletRequest request,@RequestParam(value="pageNo",defaultValue="1")Integer pageNo,@RequestParam(value="pageSize",defaultValue="10")Integer pageSize){
		ModelAndView view1 = new ModelAndView();
		List<VipInfo> vipInfos = vipInfoService.findAllVipInfo(pageNo,pageSize);
		view1.addObject("vipInfos",vipInfos);
		view1.addObject("pageNo",pageNo);
		view1.addObject("pageSize", pageSize);
		view1.setViewName("views/vip/vipInfoList");
		return view1;
	}

}
